<!doctype html>

{% if pageData["auth"] == False %}
<head>
{% include "pg/head.html" with context %}
{% include "pg/testata.html" with context %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Pg2 WEB</title>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
    <tr>
        <td align="center" class="corpo" height="480" valign="top">
        {#% include 'contacts.html' with context %#}
{% if pageData["auth"] %}
    <div id="box">&nbsp;&nbsp;Benvenuto: {{ pageData["USER"].username or "Guest" }} &nbsp;&nbsp;Ruolo:{{pageData["role"]}}
{% if pageData["role"] == "Admin" %}
        <a href="/main" class="login">PG-WEB</a><a href="/" class="login">HOME</a>
    {% else %}
            <a href="/{{pageData['subdomain'].template or ''}}/userDetail" class="login">Modifica dati</a>
    {% if "liente" in pageData["USER"].role.name or "rtner" in pageData["USER"].role.name %}
           <a href="/{{pageData['subdomain'].template or ''}}/userClientInfo" class="login">Dati utente</a>
    {% endif %}
    {% endif %}
    <a href="/logout" class="login">Logout</a></div>
 {% else %}

<form id="form1" name="form1" method="post" action="/login">
<div id="user">User</div>
<div class="entry"><input style="width:200px;" name="username" type="text" id="imputuser" size="9" /></div>
<div id="pass">Pwd</div>
<div class="entry"><input style="width:200px;" name="password" type="password" id="label" size="9" /></div>
<div id="enter"><input name="submit" type="image" id="enter" value="submit"  alt="enter" align="bottom" /></div>
</form>
{% endif %}
        </td>
    </tr>

    <tr>
        <td align="center" class="piede" valign="top">
        {#% include "pg/footer.html" with context %#}
        </td>
    </tr>
</table>
{% else %}
{% include "pg/head.html" with context %}
    <body>
    {% block body %}

        {% include "pg/testata.html" with context %}
        {% include "pg/spallasx_pg.html" with context %}
        {#% include "pg/spalladx_pg.html" with context %#}
    <div id="content">
        {% block operation %}
        {% endblock %}
        <div class="Preview"></div>
        <div class="Print"></div>
        <div class="Edit_dao"></div>
        <div class="Ricerca_complessa"></div>
        <div id="tableContainer_ac"></div>
    </div>
    {#% include "pg/footer.html" with context %#}
    {% endblock %}

{% endif %}
</body>
